<template>
  <div id="jktjFirst" ref="print">
    <div style='text-align:center;margin:0 auto;'>
      <p style="text-align: center;font-size:32px;margin-top:20px">
        <strong>健康体检表</strong>
      </p>
      <p style="text-align: left; margin-left: 30%;float: left;margin-top:50px">
        <strong>姓名：</strong>
        <span>{{form.name}}</span>
      </p>
      <p style="text-align: right; margin-right: 30%;margin-top:50px">
        <strong>编号:</strong>
        <span>{{form.jktjid}}</span>
      </p>
      <div style="page-break-after: always;">
        <table width="100%" style="text-align:center;margin-left: auto; margin-right: auto;font-family:'SimHei';line-height:26px" border="1" cellspacing="0" cellpadding="0">
          <tbody>
            <tr>
              <td colspan="2" width="18.4%">
                <p>体检日期</p>
              </td>
              <td colspan="4" width="35%">
                <span class="span_text">{{form.tjY}}</span>年
                <span class="span_text">{{form.tjM}}</span>月
                <span class="span_text">{{form.tjD}}</span>日
              </td>
              <td colspan="5" width="18%">
                <p>责任医生</p>
              </td>
              <td colspan="6">{{form.zrys}}</td>
            </tr>
            <tr>
              <td width="9.6%">
                <p>
                  <strong>
                    <strong>内 容</strong>
                  </strong>
                </p>
              </td>
              <td colspan="16" width="90.4%">
                <p>
                  <strong>
                    <strong>检 &nbsp;查 &nbsp;项 &nbsp;目</strong>
                  </strong>
                </p>
              </td>
            </tr>
            <tr>
              <td width="9.6%">
                <p>症</p>
                <p>状</p>
              </td>
              <td colspan="16" width="798">
                <p class="p_left_jktj">1无症状&nbsp;2头痛&nbsp;3头晕&nbsp;4心悸&nbsp;5胸闷&nbsp; 6胸痛&nbsp;7慢性咳嗽&nbsp; 8咳痰&nbsp; 9呼吸困难&nbsp; 10多饮
                </p>
                <p class="p_left_jktj">11多尿&nbsp; 12体重下降&nbsp;13乏力&nbsp;14关节肿痛&nbsp;15视力模糊&nbsp;16手脚麻木&nbsp; 17尿急&nbsp;18尿痛
                </p>
                <p class="p_left_jktj">19便秘&nbsp; 20腹泻&nbsp; 21恶心呕吐&nbsp; 22眼花&nbsp;23耳鸣&nbsp; 24乳房胀痛&nbsp; 25其他
                  <span class='unLine1'>{{form.jcxmzzDes}}</span>
                </p>
                <select-item :selectValue="form.jcxmzz"></select-item>
              </td>
            </tr>
            <tr>
              <td rowspan="9" width="9.6%">
                <p>一</p>
                <p>般</p>
                <p>状</p>
                <p>况</p>
              </td>
              <td colspan="2" width="17%">
                <p>体 &nbsp;&nbsp;温</p>
              </td>
              <td colspan="3" width="26%">
                <p>{{form.ybzktw}}℃</p>
              </td>
              <td colspan="3" width="17%">
                <p>脉 &nbsp;&nbsp;率</p>
              </td>
              <td colspan="8">{{form.ybzkml}}</td>
            </tr>
            <tr>
              <td colspan="2" rowspan="2" width="153">
                <p>呼吸频率</p>
              </td>
              <td colspan="3" rowspan="2" width="233">
                <p>
                  <span class="span_text">{{form.ybzkhxpl}}</span>次/分钟</p>
              </td>
              <td colspan="3" rowspan="2" width="121">
                <p>血 &nbsp;&nbsp;压</p>
              </td>
              <td colspan="4" width="83">
                <p>左 侧</p>
              </td>
              <td colspan="4" width="206">
                <p>
                  <span class="span_text">{{form.ybzkxycc}} / {{form.ybzksxycc}}</span> &nbsp;&nbsp;mmHg</p>
              </td>
            </tr>
            <tr>
              <td colspan="4" width="83">
                <p>右 侧</p>
              </td>
              <td colspan="4" width="206">
                <p>
                  <span class="span_text">{{form.ybzkxyyc}} / {{form.ybzksxyyc}}</span> &nbsp;&nbsp;mmHg</p>
              </td>
            </tr>
            <tr>
              <td colspan="2" width="153">
                <p>身 &nbsp;&nbsp;高</p>
              </td>
              <td colspan="3" width="233">
                <p>
                  <span class="span_text">{{form.ybzksg}}</span>cm</p>
              </td>
              <td colspan="3" width="121">
                <p>体 &nbsp;&nbsp;重</p>
              </td>
              <td colspan="8" width="289">
                <p>
                  <span class="span_text">{{form.ybzktz}}</span>kg</p>
              </td>
            </tr>
            <tr>
              <td colspan="2" width="153">
                <p>腰 &nbsp;&nbsp;围</p>
              </td>
              <td colspan="3" width="233">
                <p>
                  <span class="span_text">{{form.ybzkyw}}</span>cm</p>
              </td>
              <td colspan="3" width="196">
                <p>体质指数（BMI）</p>
              </td>
              <td colspan="8" width="289">
                <p>
                  <span class="span_text">{{form.ybzktzzs}}</span>Kg/m
                  <sup>2</sup>
                </p>
              </td>
            </tr>
            <tr>
              <td colspan="2" width="153">
                <p>老年人健康状态自我评估*</p>
              </td>
              <td colspan="14" width="644">
                <p class="p_left_jktj">1满意 &nbsp;2基本满意 &nbsp;3说不清楚 &nbsp;4不太满意 &nbsp;5不满意</p>
                <select-item :selectValue="form.lnrjkztzwpg"></select-item>
              </td>
            </tr>
            <tr>
              <td colspan="2" width="153">
                <p>老年人生活自理能力自我评估*</p>
              </td>
              <td colspan="14" width="644">
                <p class="p_left_jktj">1 可自理（0～3分） &nbsp;&nbsp;&nbsp;&nbsp;2轻度依赖（4～8分) </p>
                <p class="p_left_jktj">3 中度依赖（9～18分) &nbsp;&nbsp;4 不能自理(&ge;19分)</p>
                <select-item :selectValue="form.lnrshzlnlzwpg"></select-item>
              </td>
            </tr>
            <tr>
              <td colspan="2" width="153">
                <p>老年人</p>
                <p>认知功能*</p>
              </td>
              <td colspan="14" width="644">
                <p class="p_left_jktj">
                  1粗筛阴性 2粗筛阳性， 简易智力状态检查，总分
                  <span class='unLine1'></span>
                </p>
                <p class="p_right">
                  <select-item :selectValue="form.lnrrzgn"></select-item>
                </p>
              </td>
            </tr>
            <tr>
              <td colspan="2" width="153">
                <p>老年人</p>
                <p>情感状态*</p>
              </td>
              <td colspan="14" width="644">
                <p class="p_left_jktj">
                  1粗筛阴性 2粗筛阳性，老年人抑郁评分检查，总分
                  <span class='unLine1' width=80></span>
                </p>
                <select-item :selectValue="form.lnrqgzt"></select-item>
              </td>
            </tr>
            <tr>
              <td rowspan="13" width="85">
                <p>生</p>
                <p>活</p>
                <p>方</p>
                <p>式</p>
              </td>
              <td colspan="2" rowspan="3" width="153">
                <p>体育锻炼</p>
              </td>
              <td width="142">
                <p>锻炼频率</p>
              </td>
              <td colspan="13" width="501">
                <p class="p_left_jktj">1每天 2每周一次以上 3偶尔 4不锻炼</p>
                <select-item :selectValue="form.shfstydldlpl"></select-item>
              </td>
            </tr>
            <tr>
              <td width="142">
                <p>每次锻炼时间</p>
              </td>
              <td colspan="4" width="142">
                <p>
                  <span class="span_text">{{form.shfstydlmcdlsj}}</span>分钟</p>
              </td>
              <td colspan="6" width="169">
                <p>坚持锻炼时间</p>
              </td>
              <td colspan="3" width="189">
                <p>
                  <span class="span_text">{{form.shfstydljcdlsj}}</span>年</p>
              </td>
            </tr>
            <tr>
              <td width="142">
                <p>锻炼方式</p>
              </td>
              <td colspan="13" width="501">{{form.shfstydldlfs}}</td>
            </tr>
            <tr>
              <td colspan="2" width="153">
                <p>饮食习惯</p>
              </td>
              <td colspan="14" width="644">
                <p class="p_left_jktj">1荤素均衡 2荤食为主 3素食为主 4嗜盐 5嗜油 6嗜糖</p>
                <select-item :selectValue="form.shfsysxg"></select-item>
              </td>
            </tr>
            <tr>
              <td colspan="2" rowspan="3" width="153">
                <p>吸烟情况</p>
              </td>
              <td width="142">
                <p>吸烟状况</p>
              </td>
              <td colspan="13" width="501">
                <p class="p_left_jktj">1从不吸烟 2已戒烟 3吸烟 </p>
                <select-item :selectValue="form.shfsxyqkxyzk"></select-item>
              </td>
            </tr>
            <tr>
              <td width="142">
                <p>日吸烟量</p>
              </td>
              <td colspan="13" width="501">
                <p class="p_left_jktj">平均
                  <span class="span_text">{{form.shfsxyqkrxyl}}</span>支</p>
              </td>
            </tr>
            <tr>
              <td width="142">
                <p>开始吸烟年龄</p>
              </td>
              <td colspan="4" width="142">
                <p>
                  <span class="span_text">{{form.shfsxyqkksxynl}}</span>岁</p>
              </td>
              <td colspan="6" width="169">
                <p>戒烟年龄</p>
              </td>
              <td colspan="3" width="189">
                <p>
                  <span class="span_text">{{form.shfsxyqkjynl}}</span>岁</p>
              </td>
            </tr>
            <tr>
              <td colspan="2" rowspan="5" width="153">
                <p>饮酒情况</p>
              </td>
              <td width="142">
                <p>饮酒频率</p>
              </td>
              <td colspan="13" width="501">
                <p class="p_left_jktj">1从不 &nbsp;2偶尔 &nbsp;3经常 &nbsp;4每天</p>
                <select-item :selectValue="form.shfsyjqkyjpl"></select-item>
              </td>
            </tr>
            <tr>
              <td width="142">
                <p>日饮酒量</p>
              </td>
              <td colspan="13" width="501">
                <p>平均
                  <span class="span_text">{{form.shfsyjqkryjl}}</span>两</p>
              </td>
            </tr>
            <tr>
              <td width="142">
                <p>是否戒酒</p>
              </td>
              <td colspan="13" width="501">
                <p class="p_left_jktj">1未戒酒 &nbsp;2已戒酒，戒酒年龄：
                  <span class="span_text">{{form.shfsyjqkjjnl}}</span>岁</p>
                <select-item :selectValue="form.shfsyjqksfjj"></select-item>
              </td>
            </tr>
            <tr>
              <td width="142">
                <p>开始饮酒年龄</p>
              </td>
              <td colspan="4" width="142">
                <p>
                  <span class="span_text">{{form.shfsyjqkksyjnl}}</span>岁</p>
              </td>
              <td colspan="7" width="197">
                <p>近一年内是否曾醉酒</p>
              </td>
              <td colspan="2" width="162">
                <p class="p_left_jktj">1是 &nbsp;2否</p>
                <select-item :selectValue="form.shfsyjqksfzj"></select-item>
              </td>
            </tr>
            <tr>
              <td width="142">
                <p>饮酒种类</p>
              </td>
              <td colspan="13" width="501">
                <p class="p_left_jktj">
                  1白酒&nbsp;2啤酒&nbsp;3红酒&nbsp; 4黄酒&nbsp; ５其他
                  <span class='unLine1'></span>
                </p>
                <select-item :selectValue="form.shfsyjqkyjzl"></select-item>
              </td>
            </tr>
            <tr>
              <td colspan="2" width="153">
                <p>职业病危害因素接触史</p>
              </td>
              <td colspan="14" width="644">
                <select-item :selectValue="form.zybwhysjcs"></select-item>
                <p class="pb_left">1无 2有&nbsp;（工种
                  <span class='unLine1'>{{form.zybgz}}</span>从业时间
                  <span class='unLine1' style="width:140px">{{form.zybcysjn}}</span>年)</p>
                <select-item :selectValue="form.dwzlfcfhcs"></select-item>
                <p class="pb_left">毒物种类 &nbsp;粉尘
                  <span class='unLine1'>{{form.dwzlfc}}</span>&nbsp;防护措施1无 2有
                  <span class='unLine1'>{{form.dwzlfcbz}}</span>
                </p>
                <select-item :selectValue="form.dwzlfswzfhcs"></select-item>
                <p class="pb_left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;放射物质
                  <span class='unLine1'>{{form.dwzlfswz}}</span>&nbsp;防护措施1无 2有
                  <span class='unLine1'>{{form.dwzlfswzbz}}</span>
                </p>
                <select-item :selectValue="form.dwzlwlysfhcs"></select-item>
                <p class="pb_left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;物理因素
                  <span class='unLine1'>{{form.dwzlwlys}}</span>&nbsp;防护措施1无 2有
                  <span class='unLine1'>{{form.dwzlwlysbz}}</span>
                </p>
                <select-item :selectValue="form.dwzkhxwzfhcs"></select-item>
                <p class="pb_left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;化学物质
                  <span class='unLine1'>{{form.dwzlhxwz}}</span>&nbsp;防护措施1无 2有
                  <span class='unLine1'>{{form.dwzlhxwzbz}}</span>
                </p>
                <select-item :selectValue="form.dwzlqtfhcs"></select-item>
                <p class="pb_left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;其他
                  <span class='unLine1'>{{form.dwzlfhcsqt}}</span>&nbsp;防护措施1无 2有
                  <span class='unLine1'>{{form.dwzlfhcsqtbz}}</span>
                </p>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
  </div>
</template>
<script>
import {
  findObj,
  findZyList,
  findYyqkList,
  findJzsList
} from '@/api/cust/health/health'
export default {
  data() {
    return {
      loading: false,
      queryParam: {
        start: 0,
        length: 100,
        jktjid: null, //体检id
        grjbxxid: null //个人基本信息id
      },
      form: {
        jktjid: null,
        grjbxxid: null,
        tjY: '',
        tjM: '',
        tjD: ''
      },
      zyzlzys: [],
      zyzlbcs: [],
      yyqk: [],
      jzs: []
    }
  },
  created() {
    this.queryParam.grjbxxid = this.$route.query.grjbxxid
    this.queryParam.jktjid = this.$route.query.id
    this.form.grjbxxid = this.$route.query.grjbxxid
    this.form.jktjid = this.$route.query.id
    if (!this.validatenull(this.form.jktjid)) {
      this.getData()
      this.getZyZysList()
      this.getZyBcsList()
      this.getYyqkList()
      this.getJzsList()
    }
  },
  mounted() {},
  methods: {
    getData() {
      findObj(this.form).then(res => {
        if (
          res.data.code == 0 &&
          res.data.data != null &&
          !this.validatenull(res.data.data[0])
        ) {
          this.form = res.data.data[0]
          if (!this.validatenull(this.form.tjrq)) {
            const tjrq = this.form.tjrq.split('-')
            this.form.tjY = tjrq[0]
            this.form.tjM = tjrq[1]
            this.form.tjD = tjrq[2]
          }
        }
      })
    },
    //获取住院治疗情况
    //住院史
    getZyZysList() {
      findZyList(Object.assign({ zyzlqklx: '1' }, this.queryParam)).then(
        res => {
          const zysList = res.data.data
          while (zysList.length < 2) {
            zysList.push({
              index: zysList.length,
              zyzlqklx: '',
              zyzlqkrq: '',
              zyzlqkyy: '',
              zyzlqkyljgmc: '',
              zyzlqkbah: ''
            })
          }
          this.zyzlzys = zysList
        }
      )
    },
    //病床史
    getZyBcsList() {
      findZyList(Object.assign(this.queryParam), { zyzlqklx: '2' }).then(
        res => {
          const bcsList = res.data.data
          while (bcsList.length < 2) {
            bcsList.push({
              zyzlqklx: '2',
              zyzlqkrq: '',
              zyzlqkyy: '',
              zyzlqkyljgmc: '',
              zyzlqkbah: ''
            })
          }
          this.zyzlbcs = bcsList
        }
      )
    },
    //获取主要用药情况
    getYyqkList() {
      findYyqkList(this.queryParam).then(res => {
        const yyqkList = res.data.data
        while (yyqkList.length < 6) {
          yyqkList.push({
            index: yyqkList.length,
            zyyyqkywmc: '',
            zyyyqkyf: ' ',
            zyyyqkyl: '',
            zyyyqkyysj: '',
            zyyyqkfyycx: ''
          })
        }
        this.yyqk = yyqkList
      })
    },
    //获取非免疫规划预防接种史
    getJzsList() {
      this.jzs.tableLoading = true
      findJzsList(this.queryParam).then(res => {
        const jzslist = res.data.data
        while (jzslist.length < 3) {
          jzslist.push({
            fmyghyfjzsmc: '',
            fmyghyfjzsrq: ' ',
            fmyghyfjzsjg: ''
          })
        }
        this.jzs = jzslist
      })
    }
  },
  computed: {}
}
</script>
<style scoped>
td {
  line-height: 24px;
}
p {
  font-size: 15px;
  line-height: 24px;
  /* font-family: '宋体' */
}
.p_left_jktj {
  margin-left: 10px;
  display: inline_block;
  float: left;
  font-size: 15px;
  line-height: 24px;
}
</style>
